package cosc490.yahooSportsNHL.newsfeed.main;

import cosc490.yahooSportsNHL.newsfeed.R;
import cosc490.yahooSportsNHL.newsfeed.music.MusicService;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;


// Code taken from www.AndroidHive.info
public class SplashScreen extends Activity {
    private static int SPLASH_TIME_OUT = 5000;
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        startService(new Intent(SplashScreen.this, MusicService.class));
        new Handler().postDelayed(new Runnable() {
        	
            public void run() {
                Intent i = new Intent(SplashScreen.this, YahooMainActivity.class);
                startActivity(i);
                finish();
            }
        }, SPLASH_TIME_OUT);
    }
}
